home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SS0288.ZIP / SS0288_2.TXT < prev    next >
Text File  |  1992-06-01  |  34KB  |  862 lines

  1. 88H COMENT--COMMENT RECORD
  2. ==========================
  3.  
  4. Description
  5. -----------
  6.  
  7. The COMENT record contains a character string that may represent a
  8. plain text comment, a symbol meaningful to a program such as LIB or
  9. LINK, or even binary-encoded identification data. An object module can
  10. contain any number of COMENT records.
  11.  
  12. History
  13. -------
  14.  
  15. New comment classes have been added or changed for LINK386. They are:
  16. 9D, A0, A1, A2, A4, AA, B0, and B1.
  17.  
  18. Comment class A2 was added for C version 5.0. Histories for comment
  19. classes A0, A3, A4, A6, A7, and A8 are given later in this section.
  20.  
  21. 68000 and big-endian comments were added for C version 7.0.
  22.  
  23. Record Format
  24. -------------
  25.  
  26. The comment records are actually a group of items, classified by
  27. comment class.
  28.  
  29.    1   2        1       1          <-Record Length Minus 3-> 1
  30.    88  Record   Comment Comment    Commentary Byte String    Checksum
  31.        Length   Type    Class      (optional)
  32.  
  33. Comment Type
  34. ------------
  35.  
  36. The Comment Type field is bit significant; its layout is
  37.   
  38.   <-------1 byte----------------------------------------------->
  39.    NP     NL      0      0       0      0       0      0
  40.  
  41. where
  42.  
  43.    NP  (no purge bit) is set if the comment is to be preserved by
  44.        utility programs that manipulate object modules. This bit can
  45.        protect an important comment, such as a copyright message,
  46.        from deletion.
  47.        
  48.    NL  (no list bit) is set if the comment is not to be displayed by
  49.        utility programs that list the contents of object modules.
  50.        This bit can hide a comment.
  51.  
  52. The remaining bits are unused and should be set to 0.
  53.  
  54. Comment Class and Commentary Byte String
  55. ----------------------------------------
  56.  
  57. The Comment Class field is an 8-bit numeric field that conveys
  58. information by its value (accompanied by a null byte string) or
  59. indicates the information to be found in the accompanying byte string.
  60. The byte string's length is determined from the record length, not by
  61. an initial count byte.
  62.  
  63. The values that have been defined (including obsolete values) are the
  64. following:
  65.  
  66.    0        Translator     Translator; it may name the source
  67.                            language or translator. We recommend
  68.                            that the translator name and version,
  69.                            plus the optimization level used for
  70.                            compilation, be recorded here. Other
  71.                            compiler or assembler options can be
  72.                            included, although current practice
  73.                            seems to be to place these under
  74.                            comment class 9D.
  75.                            
  76.    1        Intel          Ignored by LINK. Comments of this class
  77.             copyright      are used by QuickC for padding.
  78.                            
  79.    2 - 9B   Intel          The values from 9C through FF are
  80.             reserved       ignored by Intel products.
  81.                            
  82.    81       Library        Replaced by comment class 9F; contents
  83.             specifier--    are identical to 9F.
  84.             obsolete       
  85.             
  86.    9C       MS-DOS         The byte string is then 2 bytes and
  87.             version--      specifies the MS-DOS version number.
  88.             obsolete       This comment class is not supported by
  89.                            LINK.
  90.                            
  91.    9D       Memory model-  This information is currently generated
  92.             -ignored       by the C compiler for use by the XENIX
  93.                            linker; it is ignored by the MS-DOS and
  94.                            OS/2 versions of LINK. The byte string
  95.                            consists of from one to three ASCII
  96.                            characters and indicates the following:
  97.                            
  98.                               0, 1, 2,   8086, 80186, 80286, or 
  99.                               or 3       80386 instructions 
  100.                                          generated, respectively
  101.                        
  102.                               O          Optimization performed on 
  103.                                          code
  104.                        
  105.                               s, m, c,   Small, medium, compact, 
  106.                               l, or h    large, or huge model
  107.                        
  108.                               A, B, C,   68000, 68010, 68020, or 
  109.                               D          68030 instructions 
  110.                                          generated, respectively
  111.                        
  112.    9E       DOSSEG         Sets Microsoft LINK's DOSSEG switch.
  113.                            The byte string is null. This record is
  114.                            included in the startup module in each
  115.                            language library. It directs the linker
  116.                            to use the standardized segment
  117.                            ordering, according to the naming
  118.                            conventions documented with MS-DOS,
  119.                            OS/2, and accompanying language
  120.                            products.
  121.                            
  122.    9F       Default        The byte string contains a library
  123.             library        filename (without a lead count byte and
  124.             search name    without an extension), which is
  125.                            searched in order to resolve external
  126.                            references within the object module.
  127.                            The default library search can be
  128.                            overridden with LINK's
  129.                            /NODEFAULTLIBRARYSEARCH switch.
  130.                            
  131.    A0       OMF            This class consists of a set of
  132.             extensions     records, identified by subtype (first
  133.                            byte of commentary string). Values
  134.                            supported by LINK are:
  135.                            
  136.             01     IMPDEF     Import definition record. See the
  137.                               IMPDEF section in this document for
  138.                               a complete description.
  139.                               
  140.             02     EXPDEF     Export definition record. See the
  141.                               EXPDEF section in this document for
  142.                               a complete description.
  143.                               
  144.             03     INCDEF     Incremental compilation record. See
  145.                               the INCDEF section in this document
  146.                               for a complete description.
  147.                               
  148.             04     Protected  LINK386 only; relevant only to 32-
  149.                    memory     bit dynamic-link libraries (DLLs).
  150.                    library    This comment record is inserted in
  151.                               an object module by the compiler
  152.                               when it encounters the _loadds
  153.                               construct in the source code for a
  154.                               DLL. LINK then sets a flag in the
  155.                               header of the executable file (DLL)
  156.                               to indicate that the DLL should be
  157.                               loaded in such a way that its shared
  158.                               data is protected from corruption.
  159.                               The _loadds keyword tells the
  160.                               compiler to emit modified function
  161.                               prolog code, which loads the DS
  162.                               segment register. (Normal functions
  163.                               don't need this.)
  164.                               
  165.                               When the flag is set in the .EXE
  166.                               header, the loader loads the
  167.                               selector of a protected memory area
  168.                               into DS while performing run-time
  169.                               fixups (relocations). All other DLLs
  170.                               and applications get the regular
  171.                               DGROUP selector, which doesn't allow
  172.                               access to the protected memory area
  173.                               set up by the operating system.
  174.                               
  175.             05     LNKDIR     C++ linker directives record. See
  176.                               the LNKDIR section of this document
  177.                               for a complete description.
  178.                               
  179.             06     Big-       The target for this OMF is a big-
  180.                    endian     endian machine, as opposed to little-
  181.                               endian or Intel format. (For an
  182.                               explanation of big-endian and little-
  183.                               endian, see "On Holy Wars and a Plea
  184.                               for Peace," by Danny Cohen, pages 48-
  185.                               54 in "Computer," volume 14, number
  186.                               10, October 1981.)
  187.                               
  188.             07     PRECOMP    When the CodeView information for
  189.                               this object file is emitted, the
  190.                               directory entry for $$TYPES is to be
  191.                               emitted as sstPreComp instead of
  192.                               sstTypes.
  193.                               
  194.             08-FF             Reserved by Microsoft.
  195.                               
  196.             NOTE: The presence of any unrecognized
  197.             subtype (currently, anything greater than
  198.             07) causes LINK to generate a fatal error.
  199.             
  200.    A1   "New OMF"     This comment class is now used solely to
  201.         extension     indicate the version of the symbolic debug
  202.                       information. If this comment class is not
  203.                       present, the oldest format of CodeView
  204.                       information is written to the .EXE file
  205.                       produced by LINK. If the comment class is
  206.                       present, the latest version format of
  207.                       CodeView information is written.
  208.                       
  209.                       This comment class was previously used to
  210.                       indicate that the obsolete method of
  211.                       communal representation through TYPDEF and
  212.                       EXTDEF pairs was not used and that COMDEF
  213.                       records were used instead. In current
  214.                       linkers, COMDEF records are always enabled,
  215.                       even without this comment record present.
  216.                       
  217.                       The byte string is currently empty, but the
  218.                       planned future contents will be a version
  219.                       number (8-bit numeric field) followed by an
  220.                       ASCII character string indicating the symbol
  221.                       style. Values will be:
  222.                       
  223.                           n,'C','V  CodeView style
  224.                       
  225.                           n,'D','X'  AIX style
  226.                       
  227.    A2   LINK Pass     This record conveys information to the
  228.                       linker about the organization of the file.
  229.                       The value of the first byte of the
  230.                       commentary string specifies the comment
  231.                       subtype. Currently, a single subtype is
  232.                       defined:
  233.                    
  234.                           01            Indicates the start of records 
  235.                                         generated from LINK Pass 2. 
  236.                                         Additional bytes may follow, 
  237.                                         with their number determined 
  238.                                         by the Record Length field, but 
  239.                                         they will be ignored by LINK.
  240.                                         
  241.                                         See the "Order of Records" 
  242.                                         section in this document for 
  243.                                         information on which records must 
  244.                                         come before and after this comment.
  245.                                         
  246.                                           Warning: It is assumed that 
  247.                                           this comment will not be present 
  248.                                           in a module whose MODEND record 
  249.                                           contains a program starting
  250.                                           address. If there are overlays, 
  251.                                           LINK needs to see the starting 
  252.                                           address on Pass 1 to define the 
  253.                                           symbol $$MAIN.
  254.                                         
  255.         NOTE: This comment class may become obsolete with the advent of
  256.         COMDAT records.
  257.                         
  258.    A3   LIBMOD        Library module comment record. Ignored by
  259.                       LINK; used only by Microsoft's LIB utility.
  260.                       See the LIBMOD section in this document for
  261.                       a complete description.
  262.                       
  263.    A4   EXESTR        Executable string. See the EXESTR section in
  264.                       this document for a complete description.
  265.                       
  266.    A6   INCERR        Incremental compilation error. See the
  267.                       INCERR section in this document for a
  268.                       complete description.
  269.                       
  270.    A7   NOPAD         No segment padding. See the NOPAD section in
  271.                       this document for a complete description.
  272.                       
  273.    A8   WKEXT         Weak Extern record. See the WKEXT section in
  274.                       this document for a complete description.
  275.                       
  276.    A9   LZEXT         Lazy Extern record. See the LZEXT section in
  277.                       this document for a complete description.
  278.                       
  279.    AA   PharLap       Possibly obsolete; see the PharLap section
  280.         format        in this document for a complete description.
  281.                       
  282.    B0   Initial IBM   Obsolete.
  283.         OMF386        
  284.         format.
  285.         
  286.    B1   Record order  Obsolete; part of initial IBM OMF386 format.
  287.                       
  288.    DA   Comment       For random comment.
  289.                       
  290.    DB   Compiler      For pragma comment(compiler); version
  291.                       number.
  292.                       
  293.    DC   Date          For pragma comment(date stamp).
  294.                       
  295.    DD   Timestamp     For pragma comment(timestamp).
  296.                       
  297.    DF   User          For pragma comment(user). Sometimes used for
  298.                       copyright notices.
  299.                       
  300.    E9   Dependency    Used to show the include files that were
  301.         file          used to build this .OBJ file.
  302.         (Borland)     
  303.         
  304.    FF   Command line  Shows the compiler options chosen. May be
  305.         (QuickC)      obsolete. This record is also used by
  306.                       Phoenix for library comments.
  307.                       
  308.    C0H-   Reserved     Reserved for user-defined comment classes.
  309.    FFH                 
  310.    and
  311.    not
  312.    other-
  313.    wise
  314.    used
  315.    
  316.   
  317.   NOTES
  318.   
  319.   Microsoft LIB ignores the Comment Type field.
  320.   
  321.   A COMENT record can appear almost anywhere in an object module. Only
  322.   two restrictions apply:
  323.   
  324.   - A COMENT record cannot be placed between a FIXUPP record and  the
  325.     LEDATA or LIDATA record to which it refers.
  326.   
  327.   - A COMENT record cannot be the first or last record in an  object
  328.     module. (The first record must always be THEADR or LHEADR and  the
  329.     last must always be MODEND.)
  330.   
  331. Examples
  332. --------
  333.  
  334. The following three examples are typical COMENT records taken from  an
  335. object module generated by the Microsoft C Compiler.
  336.  
  337. This first example is a language-translator comment:
  338.  
  339.         0  1  2  3  4  5  6  7  8  9  A B C D E  F 
  340.  0000   88 07 00 00 00 4D 53 20 43 6E              .....MS Cn
  341.                                                 
  342. Byte 00H contains 88H, indicating that this is a COMENT record.
  343.  
  344. Bytes 01-02H contain 0007H, the length of the remainder of the record.
  345.  
  346. Byte  03H (the Comment Type field ) contains 00H. Bit 7 (no purge)  is
  347. set  to  0, indicating that this COMENT record may be purged from  the
  348. object  module  by a utility program that manipulates object  modules.
  349. Bit 6 (no list) is set to 0, indicating that this comment need not  be
  350. excluded from any listing of the module's contents. The remaining bits
  351. are all 0.
  352.  
  353. Byte 04H (the Comment Class field) contains 00H, indicating that this
  354. COMENT record contains the name of the language translator that
  355. generated the object module.
  356.  
  357. Bytes 05H through 08H contain the name of the language  translator,
  358. Microsoft C.
  359.  
  360. Byte 09H contains the Checksum field, 6EH.
  361.  
  362.  
  363. The second example contains the name of an object library to be
  364. searched bydefault when LINK processes the object module containing
  365. this COMENT record:
  366.  
  367.         0  1  2  3  4  5  6  7  8  9  A  B  C D E F  
  368.    0000 88 09 00 00 9F 53 4C 49 42 46 50 10        .....SLIBFP
  369.  
  370. Byte 04H (the Comment Class field) contains 9FH, indicating that this
  371. record contains the name of a library for LINK to use to resolve
  372. external references.
  373.  
  374. Bytes 05-0AH contain the library name, SLIBFP. In this example,  the
  375. name refers to the Microsoft C Compiler's floating-point function
  376. library, SLIBFP.LIB.
  377.  
  378. The last example indicates that LINK should write the most recent
  379. format of CodeView information to the executable file.
  380.  
  381.       0  1  2  3  4  5  6  7   8  9  A  B   C  D   E  F  
  382. 0000  88 06 00 00 A1 01 43 56  37                        .....CV7
  383.  
  384. Byte 04H indicates the comment class, 0A1H.
  385.  
  386. Bytes 05-07H, which contain the comment string, are ignored by LINK.
  387.  
  388.  
  389. 88H IMPDEF--Import Definition Record (Comment Class A0, Subtype 01)
  390. ===================================================================
  391.  
  392. Description
  393. -----------
  394.  
  395. This record describes the imported names for a module.
  396.  
  397. History
  398. -------
  399.  
  400. This comment class and subtype is a Microsoft extension added for OS/2
  401. and Windows.
  402.  
  403. Record Format
  404. -------------
  405.  
  406. One import symbol is described; the subrecord format is
  407.                                                
  408.    1      1        <variable>   <variable>       2 or <variable>
  409.    01     Ordinal  Internal     Module           Entry
  410.           Flag     Name         Name             Ident
  411.  
  412. where:
  413.    
  414.    01              Identifies the subtype as an IMPDEF. It
  415.                    determines the form of the Entry Ident field.
  416.                    
  417.    
  418.    Ordinal Flag    Is a byte; if 0, the import is identified by
  419.                    name. If nonzero, it is identified by ordinal. It
  420.                    determines the form of the Entry Ident field.
  421.                    
  422.    Internal Name   Is in <count, char> string format and is the name
  423.                    used within this module for the import symbol.
  424.                    This name will occur again in an EXTDEF record.
  425.                    
  426.    Module Name     Is in <count, char> string format and is the name
  427.                    of the module (a DLL) that supplies an export
  428.                    symbol matching this import.
  429.                    
  430.    Entry Ident     Is an ordinal or the name used by the exporting
  431.                    module for the symbol, depending upon the Ordinal
  432.                    Flag.
  433.                    
  434.                    If this field is an ordinal (Ordinal Flag is
  435.                    nonzero), it is a 16-bit word. If this is a name
  436.                    and the first byte of the name is 0, then the
  437.                    exported name is the same as the imported name
  438.                    (in the Internal Name field). Otherwise, it is
  439.                    the imported name in <count, char> string format
  440.                    (as exported by Module Name).
  441.                    
  442.     
  443.     NOTE: IMPDEF records are created by the utility IMPLIB, which
  444.     builds an "import library" from a module definition file or DLL.
  445.  
  446. 88H EXPDEF--EXPORT DEFINITION RECORD (COMMENT CLASS A0, SUBTYPE 02)
  447. ===================================================================
  448.  
  449. Description
  450. -----------
  451.    
  452. This record describes the exported names for a module.
  453.      
  454. History
  455. -------
  456.  
  457. This comment class and subtype is a Microsoft extension added for C
  458. version 5.1.
  459.  
  460. Record Format
  461. -------------
  462.  
  463. One exported entry point is described; the subrecord format is
  464.  
  465.    1      1        <variable>   <variable>       2
  466.    02     Exported Exported     Internal         Export
  467.           Flag     Name         Name             Ordinal
  468.                                                  <conditional>
  469.  
  470. where:
  471.  
  472.   02                  Identifies the subtype as an EXPDEF.
  473.                       
  474.   Exported Flag       Is a bit-significant 8-bit field with the
  475.                       following format:
  476.  
  477.        <-----------------------1 byte---------------------------->
  478.        Ordinal  Resident    No           Parm Count
  479.        Bit      Name        Data         
  480.        1        1           1            <---------5 bits------->
  481.  
  482.  
  483.          Ordinal Bit  Is set if the item is exported by ordinal; in
  484.                       this case the Export Ordinal field is present.
  485.                       
  486.          Resident     Is set if the exported name is to be kept
  487.          Name         resident by the system loader; this is an
  488.                       optimization for frequently used items
  489.                       imported by name.
  490.                       
  491.          No Data      Is set if the entry point does not use
  492.                       initialized data (either instanced or global).
  493.                       
  494.          Parm Count   Is the number of parameter words. The Parm
  495.                       Count field is set to 0 for all but callgates
  496.                       to 16-bit segments.
  497.                       
  498.    Exported Name   Is in <count, char> string format. Name to be
  499.                    used when the entry point is imported by name.
  500.                    
  501.    Internal Name   Is in <count, char> string format. If the name
  502.                    length is 0, the internal name is the same as the
  503.                    Exported Name field. Otherwise, it is the name by
  504.                    which the entry point is known within this
  505.                    module. This name will appear as a PUBDEF or
  506.                    LPUBDEF name.
  507.                    
  508.    Export Ordinal  Is present if the Ordinal Bit field is set; it is
  509.                    a 16-bit numeric field whose value is the ordinal
  510.                    used (must be nonzero).
  511.                    
  512.           
  513.   NOTES
  514.   
  515.   EXPDEFs are produced by Microsoft compilers when the keyword _export
  516.   is used in a source file.
  517.   
  518.   Microsoft LINK limits the value of the Export Ordinal field to
  519.   16,384 bytes (16K) or less.
  520.  
  521.  
  522. 88H INCDEF--INCREMENTAL COMPILATION RECORD
  523. (COMMENT CLASS A0, SUBTYPE 03)
  524. ==========================================
  525.  
  526. Description
  527. -----------
  528.  
  529. This record is used for incremental compilation. Every FIXUPP and
  530. LINNUM record following an INCDEF record will adjust all external
  531. index values and line number values by the appropriate delta. The
  532. deltas are cumulative if there is more than one INCDEF record per
  533. module.
  534.  
  535. History
  536. -------
  537.  
  538. This comment class subtype is a Microsoft extension added for QuickC
  539. version 2.0.
  540.  
  541. Record Format
  542. -------------
  543.  
  544. The subrecord format is:
  545.  
  546.    1      2        2            <variable>
  547.    03     EXTDEF   LINNUM       Padding
  548.           Delta    Delta        
  549.  
  550. The EXTDEF Delta and LINNUM Delta fields are signed.
  551.  
  552. Padding (zeros) is added by QuickC to allow for expansion of the
  553. object module during incremental compilation and linking.
  554.   
  555.   NOTE: Negative deltas are allowed.
  556.  
  557.  
  558. 88H LNKDIR--C++ DIRECTIVES RECORD (COMMENT CLASS A0, SUBTYPE 05)
  559. =================================-------------------------------
  560.  
  561. Description
  562. -----------
  563.  
  564. This record is used by the compiler to pass directives and flags to
  565. the linker.
  566.  
  567. History
  568. -------
  569.  
  570. This comment class and subtype is a Microsoft extension added for C
  571. 7.0.
  572.  
  573. Record Format
  574. -------------
  575.  
  576. The subrecord format is:
  577.  
  578.    1      1        1                1
  579.    05     Bit      Pseudocode       CodeView
  580.           Flags    Version          Version
  581.  
  582. Bit Flags Field
  583. ---------------
  584.  
  585. The format of the Bit Flags byte is:
  586.  
  587.    8   1    1    1    1    1    1       1         1 (bits)
  588.    05  0    0    0    0    0    Run     Omit      New
  589.                                 MPC     CodeView  .EXE
  590.                                         $PUBLICS
  591.  
  592. The low-order bit, if set, indicates that LINK should output the new
  593. .EXE format; this flag is ignored for all but linking of pseudocode (p-
  594. code) applications. (Pseudocode requires a segmented executable.)
  595.  
  596. The second low-order bit indicates that LINK should not output the
  597. $PUBLICS subsection of the CodeView information.
  598.  
  599. The third low-order bit indicates that MPC (the Make Pseudocode
  600. utility) should be run.
  601.  
  602. Pseudocode Version Field
  603. ------------------------
  604.  
  605. This field is one byte indicating the pseudocode interpreter version
  606. number.
  607.  
  608. CodeView Version Field
  609. ----------------------
  610.  
  611. This field is one byte indicating the CodeView version number.
  612.  
  613.   NOTE: The presence of this record in an object module will indicate
  614.   the presence of global symbols records. The linker will not emit a
  615.   $PUBLICS section for those modules with this comment record and a
  616.   $SYMBOLS section.
  617.  
  618.  
  619. 88H LIBMOD--LIBRARY MODULE NAME RECORD (COMMENT CLASS A3)
  620. =========================================================
  621.  
  622. Description
  623. -----------
  624.  
  625. The LIBMOD comment record is used only by the LIB utility, not by
  626. LINK. It gives the name of an object module within a library, allowing
  627. LIB to preserve the source filename in the THEADR record and still
  628. identify the module names that make up the library. Since the module
  629. name is the base name of the .OBJ file that was built into the
  630. library, it may be completely different from the final library name.
  631.  
  632. History
  633. -------
  634.  
  635. This comment class and subtype is a Microsoft extension added for LIB
  636. version 3.07 in MASM version 5.0.
  637.  
  638. Record Format
  639. -------------
  640.  
  641. The subrecord format is:
  642.  
  643.    1      <variable>
  644.    A3     Module Name
  645.  
  646. The record contains only the ASCII string of the module name, in
  647. <count, char> format. The module name has no path and no extension,
  648. just the base of the module name.
  649.  
  650.   NOTES
  651.   
  652.   LIB adds a LIBMOD record when an .OBJ file is added to a library and
  653.   strips the LIBMOD record when an .OBJ file is removed from a
  654.   library, so typically this record exists only in .LIB files.
  655.   
  656.   There will be one LIBMOD record in the library file for each object
  657.   module that was combined to build the library.
  658.   
  659.   
  660. 88H EXESTR--EXECUTABLE STRING RECORD (COMMENT CLASS A4)
  661. =======================================================
  662.  
  663. Description
  664. -----------
  665.  
  666. The EXESTR comment record implements these ANSI and XENIX/UNIX
  667. features in C:
  668.  
  669.    #pragma comment(exestr, <char-sequence>)
  670.    #ident string
  671.  
  672. History
  673. -------
  674.  
  675. This comment class and subtype is a Microsoft extension added for C
  676. 5.1.
  677.  
  678. Record Format
  679. -------------
  680.  
  681. The subrecord format is:
  682.  
  683.    1      <variable>
  684.    A4     Arbitrary Text
  685.  
  686. The linker will copy the text in the Arbitrary Text field byte for
  687. byte to the end of the executable file. The text will not be included
  688. in the program load image.
  689.   
  690.   NOTE: If CodeView information is present, the text will not be at
  691.   the end of the file but somewhere before so as not to interfere with
  692.   the CodeView signature.
  693.   
  694.   There is no limit to the number of EXESTR comment records.
  695.   
  696.   
  697. 88H INCERR--INCREMENTAL COMPILATION ERROR (COMMENT CLASS A6)
  698. ============================================================
  699.  
  700. Description
  701. -----------
  702.  
  703. This comment record will cause the linker to terminate with a fatal
  704. error similar to "invalid object--error encountered during incremental
  705. compilation."
  706.  
  707. This behavior is useful when an incremental compilation fails and the
  708. user tries to link manually. The object module cannot be deleted, in
  709. order to preserve the base for the next incremental compilation.
  710.  
  711. History
  712. -------
  713.  
  714. This comment class and subtype is a Microsoft extension added for
  715. QuickC 2.0.
  716.  
  717. Record Format
  718. -------------
  719.  
  720. The subrecord format is:
  721.  
  722.    1      
  723.    A6     No Fields
  724.  
  725.  
  726. 88H NOPAD--NO SEGMENT PADDING (COMMENT CLASS A7)
  727. ================================================
  728.  
  729. Description
  730. -----------
  731.  
  732. This comment record identifies a set of segments that are to be
  733. excluded from the padding imposed with the /PADDATA or /PADCODE
  734. options.
  735.  
  736. History
  737. -------
  738.  
  739. This comment class and subtype is a Microsoft extension added for
  740. COBOL. It was added to LINK to support MicroFocus COBOL version 1.2;
  741. it was added permanently in LINK version 5.11 to support Microsoft
  742. COBOL version 3.0.
  743.  
  744. Record Format
  745. -------------
  746.  
  747. The subrecord format is:
  748.  
  749.    1      1 or 2
  750.    A7     SEGDEF Index
  751.           <---------repeated---------->
  752.  
  753. The SEGDEF Index field is the standard OMF index type of 1 or 2 bytes.
  754. It may be repeated.
  755.  
  756.  
  757. 88H WKEXT--WEAK EXTERN RECORD (COMMENT CLASS A8)
  758. ================================================
  759.  
  760. Description
  761. -----------
  762.  
  763. This record marks a set of external names as "weak," and for every
  764. weak extern, the record associates another external name to use as the
  765. default resolution.
  766.  
  767. History
  768. -------
  769.  
  770. This comment class and subtype is a Microsoft extension added for
  771. Basic version 7.0. There is no construct in Basic that produces it,
  772. but the record type is manually inserted into Basic library modules.
  773.  
  774. The first user-accessible construct to produce a weak extern was added
  775. for MASM version 6.0.
  776.  
  777. See the "Notes" section below for details on how and why this record
  778. is used in Basic and MASM.
  779.  
  780. Record Format
  781. -------------
  782.  
  783. The subrecord format is:
  784.  
  785.    1      1 or 2      1 or 2
  786.    A8     Weak EXTDEF Default Resolution
  787.           Index       EXTDEF Index
  788.           <------------repeated------------>
  789.  
  790. The Weak EXTDEF Index field is the 1- or 2-byte index to the EXTDEF of
  791. the extern that is weak.
  792.  
  793. The Default Resolution EXTDEF Index field is the 1- or 2-byte index to
  794. the EXTDEF of the extern that will be used to resolve the extern if no
  795. "stronger" link is found to resolve it.
  796.   
  797.   NOTES
  798.   
  799.   There are two ways to cancel the "weakness" of a weak extern; both
  800.   result in the extern becoming a "strong" extern (the same as an
  801.   EXTDEF). They are:
  802.   
  803.     -If a PUBDEF for the weak extern is linked in
  804.     -If an EXTDEF for the weak extern is found in another module
  805.      (including libraries)
  806.   
  807.   If a weak extern becomes strong, then it must be resolved with a
  808.   matching PUBDEF, just like a regular EXTDEF. If a weak extern has
  809.   not become strong by the end of the linking process, then the
  810.   default resolution is used.
  811.   
  812.   If two weak externs for the same symbol in different modules have
  813.   differing default resolutions, LINK will emit a warning.
  814.   
  815.   Weak externs do not query libraries for resolution; if an extern is
  816.   still weak when libraries are searched, it stays weak and gets the
  817.   default resolution. However, if a library module is linked in for
  818.   other reasons (say, to resolve strong externs) and there are EXTDEFs
  819.   for symbols that were weak, the symbols become strong.
  820.   
  821.   For example, suppose there is a weak extern for "var" with a default
  822.   resolution name of "con". If there is a PUBDEF for "var" in some
  823.   library module that would not otherwise be linked in, then the
  824.   library module is not linked in, and any references to "var" are
  825.   resolved to "con". However, if the library module is linked in for
  826.   other reasons--for example, to resolve references to a strong extern
  827.   named "bletch"-- then "var" will be resolved by the PUBDEF from the
  828.   library, not to the default resolution "con".
  829.   
  830.   WKEXTs are best understood by explaining why they were added in the
  831.   first place. The minimum Basic run-time library in the past
  832.   consisted of a large amount of code that was always linked in, even
  833.   for the smallest program. Most of this code was never called
  834.   directly by the user, but it was called indirectly from other
  835.   routines in other libraries, so it had to be linked in to resolve
  836.   the external references.
  837.   
  838.   For instance, the floating-point library was linked in even if the
  839.   user's program did not use floating-point operations, because the
  840.   PRINT library routine contained calls to the floating-point library
  841.   for support to print floating-point numbers.
  842.   
  843.   The solution was to make the function calls between the libraries
  844.   into weak externals, with the default resolution set to a small stub
  845.   routine. If the user never used a language construct or feature that
  846.   needed the additional library support, then no strong extern would
  847.   be generated by the compiler and the default resolution (to the stub
  848.   routine) would be used. However, if the user accessed the library's
  849.   routines or used constructs that required the library's support, a
  850.   strong extern would be generated by the compiler to cancel the
  851.   effect of the weak extern, and the library module would be linked
  852.   in. This required that the compiler know a lot about which libraries
  853.   are needed for which constructs, but the resulting executable was
  854.   much smaller.
  855.   
  856.   The construct in MASM 6.0 that produces a weak extern is
  857.   
  858.       EXTERN var(con): byte
  859.   
  860.   which makes "con" the default resolution for weak extern "var".
  861.  
  862.